package com.example.newproject_overseas.components


import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.buildAnnotatedString
import androidx.compose.ui.text.withStyle
import androidx.compose.ui.tooling.preview.Preview

@Composable
fun ClickableColoredText() {
    val annotatedString = buildAnnotatedString {
        withStyle(SpanStyle(color = Color.Black)) {
            append("I have read and agreed ")
        }
        withStyle(SpanStyle(color = Color.Red)) {
            append("(Loan House's Privacy Agreement Conditions and Terms)")
            addStringAnnotation("Clickable", "ClickableText", 0, length)
        }
        withStyle(SpanStyle(color = Color.Black)) {
            append("the agreement is highlighted,clickto view, the agreement is checked by default and you can click to cancel the check")
        }
    }
}


